package it.lorenz.server.core.services.login;

import it.lorenz.server.core.entities.User;
import it.lorenz.server.fk.business.AbstractDBBusinessService;
import it.lorenz.server.fk.business.AbstractDTO;
import it.lorenz.server.fk.business.ex.AbstractBusinessException;

public class LoginBS extends AbstractDBBusinessService {

    @Override
    public AbstractDTO callBusinessService(AbstractDTO dto) throws AbstractBusinessException {
        LoginDTO real = (LoginDTO) dto;
        User user = getBaseDAO().selectNamedQueryUniqueResult(User.class, "user.login", real.getUsername());
        real.setUser(user);
        return real;
    }
}
